Skip to content

Conversation

@adamziel
Copy link
Collaborator

Motivation for the change, related issues

Studio noted they can't easily used a local, unzipped WordPress directory:

Playground CLI always tries to download and install WordPress if we don't have the skipWordpressSetup flag

This PR separates skipping the download from skipping the installation.

Implementation

This PR adds a new CLI option called --wordpress-install-mode with the following supported values:

  • download-and-install (default)
  • install-from-existing-files
  • install-from-existing-files-if-needed
  • assume-already-installed

Supersedes #2786

Testing instructions

Run

alias pgcli="node --no-warnings=ExperimentalWarning  --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts"

# This should install an already downloaded WordPress
pgcli server --wordpress-install-mode=download-and-install --mount-before-install=./unzipped-wp-directory:/wordpress

# This should install WordPress without downloading it first
pgcli server --wordpress-install-mode=install-from-existing-files --mount-before-install=./unzipped-wp-directory:/wordpress

cc @bcotrim @brandonpayton

adamziel and others added 7 commits October 21, 2025 12:39
## Motivation for the change, related issues
Part of #2202

Add Japanese translations to   JavaScript API
## Motivation for the change, related issues

Importing WXR content with URL rewriting enabled replaces the protocol
in some URLs from `https` to `http`.

## Implementation details

Sets `$_SERVER['HTTPS'] = "on"` in the `importWxr` Blueprint step. The
`php.run()` method called in the `importWxr` step does not set it
automatically – that's a role of the request handler. The WXR importer
relies on the `get_site_url()` WordPress function, which weirdly takes
the `site_url` option and replaces the protocol based on the
`$_SERVER['https']` value.

## Testing Instructions (or ideally a Blueprint)

Import this WXR file via `?importWxr` query parameter and confirm all
the URLs are https:


https://gist.github.com/adamziel/a3d1a1941608e068e4b3d557ee2e8202/raw/aa659a130e1104cedeea8a63155a117dcb693dc8/tt25export.xml

The tricky part is, you need to serve Playground on a https url for this
to work.

cc @bph
@adamziel adamziel requested a review from a team as a code owner October 21, 2025 15:48
Copy link
Member

@brandonpayton brandonpayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some failing tests, but this reads well to me. Thank you, @adamziel!

* just as the web request layer would.
*/
HTTPS: (await playground.absoluteUrl).startsWith('https://') ? 'on' : '',
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamziel Is change intentional as part of this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! It got intertwined, a rebase will solve it – that's already merged into trunk

@brandonpayton
Copy link
Member

I merged trunk into this PR and fixed the single failing test. Let's see how the tests do in CI.

@adamziel
Copy link
Collaborator Author

adamziel commented Nov 4, 2025

we may need another merge but other than that this is good to go. Thank you for jumping in @brandonpayton!

@adamziel
Copy link
Collaborator Author

adamziel commented Nov 4, 2025

I don't think the test failures are related to this change, they're mostly timeouts. That, and the tests already passed before the merge. And their JSPI counterparts pass. Let's merge. Thank you for grooming this branch @brandonpayton !

@adamziel adamziel merged commit cae150a into trunk Nov 4, 2025
28 of 29 checks passed
@adamziel adamziel deleted the wordpress-install-mode-flag branch November 4, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants